package jdbc;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;
import java.util.Scanner;

public class RegDemo {
    public static void main(String[] args) throws Exception {
     UserInfo userInfo =  InputUtil.getInputObject(new UserInfo(),"删除用户","用户");
        System.out.println(userInfo);









//        Class.forName("com.mysql.cj.jdbc.Driver");
//        Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/mysql?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true","root","root");
//        System.out.println("与数据库建立连接");
//        Statement statement = connection.createStatement();
//        System.out.println("请输入你的用户名，密码，昵称，年龄");
//        Scanner scanner = new Scanner(System.in);
//        String username = scanner.nextLine();
//        String password = scanner.nextLine();
//        String nickname = scanner.nextLine();
//      int age= Integer.parseInt( scanner.nextLine());
//        String sql="INSERT INTO userinfo(username,password,nickname,age) " +
//                "VALUES ("+username+","+password+","+nickname+","+age+")";
//        System.out.println(sql);
//        statement.executeUpdate(sql);
//            System.out.println("插入数据成功");
//            connection.close();

    }
}
